home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SNNSV32.ZIP / SNNSv3.2 / kernel / sources / cc_mac.h < prev    next >
C/C++ Source or Header  |  1994-04-25  |  4KB  |  136 lines

  1. /*****************************************************************************
  2.   FILE           : cc_mac.h
  3.   SHORTNAME      : mac.h
  4.   SNNS VERSION   : 3.2
  5.  
  6.   PURPOSE        : macros for cascade correlation
  7.   NOTES          :
  8.  
  9.   AUTHOR         : Michael Schmalzl
  10.   DATE           : 24.2.93
  11.  
  12.   CHANGED BY     : 
  13.   IDENTIFICATION : @(#)cc_mac.h    1.10 3/15/94
  14.   SCCS VERSION   : 1.10
  15.   LAST CHANGE    : 3/15/94
  16.  
  17.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  18.  
  19. ******************************************************************************/
  20.  
  21. #ifndef _CC_MAC_DEFINED_
  22. #define _CC_MAC_DEFINED_
  23.  
  24. #define CC 1
  25. #define RCC 2
  26.  
  27. #define OFF 0
  28. #define ON  1
  29.  
  30. #define ASYM_SIGMOID 0
  31. #define SYM_SIGMOID  1
  32. #define TANH         2
  33. #define RANDOM       3
  34.  
  35. #define QUICKPROP    0
  36. #define BACKPROP     1
  37. #define RPROP        2
  38.  
  39. #define CASCADE      1
  40. #define NO_CASCADE   0
  41.  
  42. /* output parameter definitions */
  43. #define  OUT_PATIENCE                  50 
  44. #define  MAX_NO_OF_ERROR_UPDATE_CYCLES 200
  45. #define  MIN_ERROR_CHANGE              0.01
  46.  
  47. /* special parameter definitions */
  48. #define  SPECIAL_PATIENCE                   25 
  49. #define  MAX_NO_OF_COVARIANCE_UPDATE_CYCLES 200
  50. #define  MIN_COVARIANCE_CHANGE              0.04
  51. #define  MAX_SPECIAL_UNIT_NO                8
  52. #define  SPECIAL_FUNC_TYPE                  SYM_SIGMOID
  53.  
  54. /* global parameter definitions */
  55. #define  MAX_PIXEL_ERROR 0.2
  56. #define  LEARNING_FUNC   QUICKPROP
  57. #define  ON_OFF   ON
  58.  
  59. #define NO_OF_ACT_FUNCS 4
  60.  
  61. #define X_MIN_POS 2
  62. #define Y_MIN_POS 2
  63. #define HIDDEN_LAYER_HEIGHT 5     /* in 10 aendern */
  64. #define MIN_HIDDEN_LAYER_HEIGHT 5
  65.  
  66. #define CC_TEST 0
  67.  
  68. #define CONTINUE_LEARNING 1
  69. #define STOP_LEARNING 0
  70.  
  71. #define CC_MAX_VALUE  0.1 
  72. #define RCC_MAX_VALUE 1.0
  73. #define FLOAT_MAX 1E+37
  74.  
  75. #define LN_CURRENT_SLOPE(LinkPtr)       LinkPtr->value_a
  76. #define LN_PREVIOUS_SLOPE(LinkPtr)      LinkPtr->value_b
  77. #define LN_LAST_WEIGHT_CHANGE(LinkPtr)  LinkPtr->value_c
  78.  
  79. #define BIAS_CURRENT_SLOPE(UnitPtr)      UnitPtr->value_a
  80. #define BIAS_PREVIOUS_SLOPE(UnitPtr)     UnitPtr->value_b
  81. #define BIAS_LAST_WEIGHT_CHANGE(UnitPtr) UnitPtr->value_c
  82.  
  83.  
  84. #define  NET_ERROR( param )      param[ 0 ]  /*    returns the net error   */
  85.  
  86. #define GET_UNIT_NO(UnitPtr) \
  87.    UnitPtr - unit_array  
  88.  
  89. #define GET_UNIT_XPOS(UnitPtr) \
  90.    (*UnitPtr).unit_pos.x
  91.  
  92. #define GET_UNIT_YPOS(UnitPtr) \
  93.    (*UnitPtr).unit_pos.y
  94.  
  95. #define SET_UNIT_XPOS(UnitPtr,XPos) \
  96.    (*UnitPtr).unit_pos.x = XPos 
  97.  
  98. #define SET_UNIT_YPOS(UnitPtr,YPos) \
  99.    (*UnitPtr).unit_pos.y = YPos
  100.  
  101. #define ERROR_CHECK \
  102.    if(KernelErrorCode!=KRERR_NO_ERROR) { \
  103.      return(KernelErrorCode); \
  104.    }  
  105.  
  106. #define CC_ERROR(ErrorCode) \
  107.    return(ErrorCode)
  108.  
  109. #define IF_PTR_IS_NOT_NULL(ptr) if(ptr!=NULL)
  110.  
  111. #define FOR_ALL_INPUT_UNITS(UnitPtr,i) \
  112.    for(UnitPtr= *FirstInputUnitPtr,i=0;UnitPtr!=NULL;UnitPtr=FirstInputUnitPtr[++i])
  113.  
  114. #define FOR_ALL_HIDDEN_UNITS(UnitPtr,h) \
  115.    for(UnitPtr= *FirstHiddenUnitPtr,h=0;UnitPtr!=NULL;UnitPtr=FirstHiddenUnitPtr[++h])
  116.  
  117. #define FOR_ALL_OUTPUT_UNITS(UnitPtr,o) \
  118.    for(UnitPtr= *FirstOutputUnitPtr,o=0;UnitPtr!=NULL;UnitPtr=FirstOutputUnitPtr[++o])
  119.  
  120. #define FOR_ALL_SPECIAL_UNITS(UnitPtr,s) \
  121.    for(UnitPtr= *FirstSpecialUnitPtr,s=0;UnitPtr!=NULL;UnitPtr=FirstSpecialUnitPtr[++s])
  122.           
  123. #define FOR_ALL_PATTERNS(StartPattern,EndPattern,p) \
  124.    for(p=StartPattern;p<=EndPattern;p++)
  125.  
  126. #define SIGN(n) ((n > 0) ? (1) : (-1))
  127.  
  128. #define GET_RECURRENT_LINK(unit_ptr,link_ptr) \
  129.    (link_ptr) = (struct Link *) (unit_ptr)->sites 
  130.  
  131. #define FOR_ALL_NOT_RECURRENT_LINKS( unit_ptr, link_ptr ) \
  132. for ((link_ptr) = ((struct Link *) (unit_ptr)->sites)->next; (link_ptr) != NULL; \
  133.      (link_ptr) = (link_ptr)->next)
  134.  
  135. #endif
  136.